package pl.wr.physics.units;

import pl.wr.math.number.Fraction;

/**
 * Fundamental physical constants
 * 
 * @version 1.0
 * @author wieslaw.rodak
 * 
 */
public enum Constants {

	/**
	 * The unified atomic mass unit u = 1.660538921(73)×10<sup>-27</sup> kg
	 */
	u(new Fraction(1.660538921, -27, 73)),

	/**
	 * The elementary charge, the electric charge carried by a single proton e = 1.602176565(35)×10<sup>-19</sup> C
	 */
	e(new Fraction(1.602176565, -19, 35)),

	/**
	 * The vacuum permeability μ0 = 4π×10<sup>-7</sup> = 1.2566370614×10<sup>-6</sup> H/m
	 */
	μ0(new Fraction(4 * Math.PI, -7)),

	/**
	 * Speed of light in vacuum c = 2.99792458×10<sup>8</sup> m s<sup>-1</sup>
	 */
	c(new Fraction(2.99792458, 8, Fraction.EXACTLY)),
	
	/**
	 * The vacuum permittivity ε0 = 8.854187817×10<sup>-12</sup> F/m
	 */
	ε0(new Fraction(1 / (Math.pow(c.getValue().doubleValue(), 2) * μ0.getValue().doubleValue()))),
	// ε0(new Fraction(8.854187817, -12)),

	/**
	 * Gravitational constant G = 6.67384(80)×10<sup>-11</sup> m<sup>3</sup> kg<sup>-1</sup> s<sup>-2</sup>
	 */
	G(new Fraction(6.67384, -11, 80)),

	/**
	 * Planck constant h = 6.62606957(29)×10<sup>-34</sup> J s
	 */
	h(new Fraction(6.62606957, -34, 29)),

	/**
	 * Reduced Planck constant ħ = h/2π = 1.054571726(47)×10<sup>-34</sup> J s
	 */
	ħ(new Fraction(h.getValue().doubleValue() / (2 * Math.PI), 0, 47)),

	/**
	 * Coulomb constant (4πε0)<sup>-1</sup> = 8.9875517873681764×10<sup>9</sup> kg m<sup>3</sup> s<sup>-2</sup>
	 * C<sup>-2</sup>
	 */
	_cc(new Fraction(8.9875517873681764, 9, Fraction.EXACTLY)),

	/**
	 * Boltzmann constant k = 1.3806488×(13)10<sup>-23</sup> J/K
	 */
	k(new Fraction(1.3806488, -23, 13)), ;

	private final Fraction value;

	private Constants(Fraction value) {
		this.value = value;
	}

	public Fraction getValue() {
		return value;
	}

}
